<template>
  <div class="add_channels_wrap">
    <el-button type="text" size="small" @click="showPlay">点击播放</el-button>
    <el-dialog
      v-if="pop_show"
      :title="this.$props.title"
      :visible.sync="pop_show"
      :close-on-click-modal="false"
      append-to-body
    >
      <el-row>
        <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
          <vab-player-mp4 :config="config" @player="Player = $event" />
        </el-col>
      </el-row>
    </el-dialog>
  </div>
</template>

<script>
  import { VabPlayerMp4 } from '@/plugins/vabPlayer.js'

  export default {
    name: 'IndexPlayer',
    components: {
      VabPlayerMp4,
    },
    props: {
      id: {
        type: Number,
        default: 0,
      },
      url: {
        type: String,
        default: '',
      },
      title: {
        type: String,
        default: '',
      },
    },

    data() {
      return {
        pop_show: false,
        Player: null,
        config: {
          id: 'mse2',
          url: this.$props.url,
          volume: 1,
          autoplay: false,
        },
      }
    },
    mounted() {},
    methods: {
      showPlay() {
        this.pop_show = true
      },
    },
  }
</script>
